home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 270_01 / vid_demo.c < prev    next >
Text File  |  1980-01-01  |  3KB  |  113 lines

  1. /* HEADER: CUG270;
  2.    TITLE: Video Demonstration
  3.    DATE: 04/11/1988
  4.    DESCRIPTION: Demonstration of various video routines
  5.    VERSION: 1.0
  6.    KEYWORDS: VIDEO, BIOS FUNCTIONS
  7.    FILENAME: VID_DEMO.C
  8.    WARNINGS: Dependant on ROM BIOS
  9.    SEE-ALSO: VIDEO.H
  10.    SYSTEM: MS-DOS
  11.    COMPILERS: Turbo C & Microsoft C v4.0
  12.    AUTHORS: Marc Bosser
  13.  
  14.     Comments, questions, bugs & suggestions
  15.         Monday, Wedndesday, Friday, Sunday
  16.     Contact ME: Marc Bosser
  17.             1922 Julia Goldbach
  18.             Ronkonkoma, NY 11779
  19.  
  20. */
  21.  
  22.         /************************************************/
  23.         /*   File Name:VID_DEMO.C                   */
  24.         /*   C File:3,101 bytes                       */
  25.         /*   Object File:1,673 bytes                   */
  26.         /*   Portability:VANILLA but depends on VIDEO.H */
  27.         /*                                       */
  28.         /* CONTAINS: MAIN                           */
  29.         /*                                       */
  30.         /* Total: 1 routine                           */
  31.         /* External: cprintf, getch                   */
  32.         /* User Defined: xy,fill,ewriteM               */
  33.         /************************************************/
  34.  
  35. #include "DOS.H"            /* NEEDED TO COMPILE VIDEO.H(int86)*/
  36. #include "CONIO.H"            /* NEEDED TO COMPILE cprintf,getch */
  37. #include "VIDEO.H"            /* CONTAINS ALL VIDEO FUNCTIONS    */
  38.  
  39. /******************************************************************************/
  40.  
  41. #ifdef __TURBOC__
  42. void main(void)
  43. #else
  44. main()
  45. #endif
  46.  
  47. {
  48.  unsigned short loop=1;
  49.  unsigned int delay=0;
  50.  unsigned short color=0;
  51.  unsigned int y1=22;
  52.  unsigned int x1=1;
  53.  unsigned int length=60;
  54.  unsigned int x2=24;
  55.  
  56.  fill(1,1,80,25,7);        /* this effectively clears the screen in gray */
  57.  xy(1,1);
  58.  cprintf("Lets fill the screen will cprintf\n\r");
  59.  do {
  60.     cprintf("███████████████████████████████████████████████████████████████████████████████\n\r");
  61.     /* In quotes are 79 ASCII characters 219 */
  62.     loop++;
  63.  } while (loop < 24);
  64.  cprintf("HIT ANY KEY TO CONTINUE");
  65.  getch();
  66.  fill(1,1,80,25,7);
  67.  xy(1,1);
  68.  cprintf("Lets color the screen with fill");
  69.  loop=1;
  70.  do    {
  71.     y1-=3;
  72.     x1+=2;
  73.     length-=2;
  74.     color=loop*16;
  75.     fill(y1,x1,length,x2,color);
  76.     loop++;
  77.     for (delay=0; delay < 32000; delay++) ;;
  78.  } while (loop < 8);
  79.  cprintf("\n\rHIT ANY KEY TO CONTINUE");
  80.  getch();
  81.  loop=1;
  82.  do    {
  83.     fill(1,1,80,25,7);
  84.     xy(1,1);
  85.     cprintf("Have you ever needed to turn the cursor off during input.\n\r");
  86.     cprintf("Well this could be your chance all it  takes  is  a  call\n\r");
  87.     cprintf("to cursoroff a routine that locates the  cursor  at  0,25\n\r");
  88.     cprintf("a non existant position.\n\r");
  89.     if (loop == 1)
  90.         {
  91.         xy(1,7);
  92.         cprintf("That cursor hanging around is just unprofessional.\n\r");
  93.         }
  94.     cprintf("\n\nHIT ANY KEY TO CONTINUE");
  95.     if (loop == 2) cursoroff();
  96.     getch();
  97.     loop++;
  98.  } while (loop < 3);
  99.  fill(1,1,80,25,7);
  100.  xy(1,1);
  101.  cprintf("Have you ever needed a function that can write any amount of any character.\n\r");
  102.  cprintf("Now you have it, it is called ewriteM\n\r");
  103.  loop=3;
  104.  do    {
  105.     ewriteM(1,loop,loop+44,70);
  106.     loop++;
  107.  } while (loop < 24);
  108. }
  109.  
  110. /******************************************************************************/
  111.  
  112.                 /**** END OF VID_DEMO.C ****/
  113.